package ldh.im.admin.dao;

import ldh.im.admin.pojo.User;
import ldh.im.admin.pojo.where.UserWhere;

import java.util.List;

/**
* @author: ldh
* @date: 2019-10-25 12:35:06
*/
public interface UserDao {

	Integer insert(User user);

	Integer insertSelective(User user);

	Integer updateByUserName(User user);
	
	Integer updateNotNullByUserName(User user);
	
	Integer deleteByUserName(String userName);

	Integer updateByPhone(User user);
	
	Integer updateNotNullByPhone(User user);
	
	Integer deleteByPhone(String phone);

	Integer updateByEmail(User user);
	
	Integer updateNotNullByEmail(User user);
	
	Integer deleteByEmail(String email);

	Integer updateById(User user);
	
	Integer updateNotNullById(User user);
	
	Integer deleteById(Long id);

	User getByUserName(String userName);

	User getByUserNameOnly(String userName);

	User getByPhone(String phone);

	User getByPhoneOnly(String userName);

	User getByEmail(String email);

	User getByEmailOnly(String email);

	User getById(Long id);

	List<User> getByIds(List<Long> ids);

	User getJoinById(Long id);

	User getManyRolesById(Long id);

	User getByKey(String key);

	User getAllByKey(String key);

	List<User> findByUserWhere(UserWhere userWhere);
	
	Long findTotalByUserWhere(UserWhere userWhere);
	
	List<User> findJoinByUserWhere(UserWhere userWhere);
	
	Long findJoinTotalByUserWhere(UserWhere userWhere);
	
}
